// ABP 8.3.4 用户管理类型定义

import type { AbpPagedParams, AbpPagedResult } from '../types';

// 用户列表项
export interface UserDto {
  id: string;
  userName: string;
  name: string;
  surname: string;
  email: string;
  emailConfirmed: boolean;
  phoneNumber: string;
  phoneNumberConfirmed: boolean;
  isActive: boolean;
  lockoutEnabled: boolean;
  lockoutEnd?: string;
  concurrencyStamp: string;
  lastModificationTime?: string;
  lastModifier?: UserDto;
  creationTime: string;
  creator?: UserDto;
  roleNames: string[];
}

// 用户创建DTO
export interface CreateUserDto {
  userName: string;
  name: string;
  surname: string;
  email: string;
  phoneNumber?: string;
  isActive: boolean;
  lockoutEnabled: boolean;
  roleNames: string[];
  password: string;
}

// 用户更新DTO
export interface UpdateUserDto {
  userName: string;
  name: string;
  surname: string;
  email: string;
  phoneNumber?: string;
  isActive: boolean;
  lockoutEnabled: boolean;
  roleNames: string[];
  password?: string;
  concurrencyStamp: string;
}

// 用户请求参数
export interface GetUsersInput extends AbpPagedParams {
  filter?: string;
}

// 用户列表响应
export type GetUsersOutput = AbpPagedResult<UserDto>;


// 角色DTO
export interface RoleDto {
  id: string;
  name: string;
  isDefault: boolean;
  isStatic: boolean;
  isPublic: boolean;
  concurrencyStamp: string;
}

// 获取角色列表响应
export type GetRolesOutput = { items: RoleDto[] };

// 用户角色分配项
export interface UserRoleItem {
  roleId: string;
  roleName: string;
  isAssigned: boolean;
}

// // 用户角色分配DTO
// export interface UserRoleDto {
//   items: UserRoleItem[];
// }
export interface UserRoleDto  {
  items: RoleDto[];
};

// 更新用户角色请求
export interface UpdateUserRolesDto {
  roleNames: string[];
}
